package com.regent.central.bill.repository.mrp.dto;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;

/**
 * 新建采购单DTO
 *
 * @author 钟宝林
 * @date 2018-06-15 11:19
 **/
public class MaterialPurchaseAddDTO implements Serializable {
    private static final long serialVersionUID = -1784389963479927651L;

    /**
     * 组织ID
     */
    private String unitId;
    /**
     * 老板组织ID
     */
    private String bossUnitId;
    /**
     * 采购时间
     */
    private String datePurchase;
    /**
     * 采购单号
     */
    private String orderNo;
    /**
     * 预计货期
     */
    private String expectDateEnd;
    /**
     * 到料仓库ID
     */
    private String arriveStorehouseId;
    /**
     * 采购员ID
     */
    private String creatorId;
    /**
     * 采购员名称
     */
    private String creatorName;
    /**
     * 付款金额
     */
    private BigDecimal amountPay;
    /**
     * 备注
     */
    private String remark;
    /**
     * 物料采购商ID
     */
    private String supplierId;
    /**
     * 物料采购列表
     */
    private Set<PurchaseAddMaterialsSkuDTO> materialsSkus = new HashSet<>();

    public String getDatePurchase() {
        return datePurchase;
    }

    public void setDatePurchase(String datePurchase) {
        this.datePurchase = datePurchase;
    }

    public String getUnitId() {
        return unitId;
    }

    public void setUnitId(String unitId) {
        this.unitId = unitId;
    }

    public String getBossUnitId() {
        return bossUnitId;
    }

    public void setBossUnitId(String bossUnitId) {
        this.bossUnitId = bossUnitId;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getExpectDateEnd() {
        return expectDateEnd;
    }

    public void setExpectDateEnd(String expectDateEnd) {
        this.expectDateEnd = expectDateEnd;
    }

    public String getArriveStorehouseId() {
        return arriveStorehouseId;
    }

    public void setArriveStorehouseId(String arriveStorehouseId) {
        this.arriveStorehouseId = arriveStorehouseId;
    }

    public String getCreatorId() {
        return creatorId;
    }

    public void setCreatorId(String creatorId) {
        this.creatorId = creatorId;
    }

    public String getCreatorName() {
        return creatorName;
    }

    public void setCreatorName(String creatorName) {
        this.creatorName = creatorName;
    }

    public BigDecimal getAmountPay() {
        return amountPay;
    }

    public void setAmountPay(BigDecimal amountPay) {
        this.amountPay = amountPay;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getSupplierId() {
        return supplierId;
    }

    public void setSupplierId(String supplierId) {
        this.supplierId = supplierId;
    }

    public Set<PurchaseAddMaterialsSkuDTO> getMaterialsSkus() {
        return materialsSkus;
    }

    public void setMaterialsSkus(Set<PurchaseAddMaterialsSkuDTO> materialsSkus) {
        this.materialsSkus = materialsSkus;
    }

    public static class PurchaseAddMaterialsSkuDTO {
        /**
         * 物料skuID
         */
        private String materialsSkuId;
        /**
         * 工单ID
         */
        private String facMissionId;
        /**
         * 成衣款号
         */
        private String styleNo;
        /**
         * 物料款式ID
         */
        private String materialsId;
        /**
         * 物料款号
         */
        private String materialsNo;
        /**
         * 本次采购数量
         */
        private BigDecimal quantity;
        /**
         * 单价
         */
        private BigDecimal priceUnit;
        /**
         * 采购类型  0: 按工单bom需求采购 1: 计划外采购
         */
        private int type;
        /**
         * 是否直接到料
         */
        private boolean directArrive;

        public PurchaseAddMaterialsSkuDTO() {
        }

        public String getMaterialsSkuId() {
            return materialsSkuId;
        }

        public void setMaterialsSkuId(String materialsSkuId) {
            this.materialsSkuId = materialsSkuId;
        }

        public String getFacMissionId() {
            return facMissionId;
        }

        public void setFacMissionId(String facMissionId) {
            this.facMissionId = facMissionId;
        }

        public BigDecimal getQuantity() {
            return quantity;
        }

        public void setQuantity(BigDecimal quantity) {
            this.quantity = quantity;
        }

        public BigDecimal getPriceUnit() {
            return priceUnit;
        }

        public void setPriceUnit(BigDecimal priceUnit) {
            this.priceUnit = priceUnit;
        }

        public Integer getType() {
            return type;
        }

        public void setType(Integer type) {
            this.type = type;
        }

        public boolean isDirectArrive() {
            return directArrive;
        }

        public void setDirectArrive(boolean directArrive) {
            this.directArrive = directArrive;
        }

        public void setType(int type) {
            this.type = type;
        }

        public String getStyleNo() {
            return styleNo;
        }

        public void setStyleNo(String styleNo) {
            this.styleNo = styleNo;
        }

        public String getMaterialsId() {
            return materialsId;
        }

        public void setMaterialsId(String materialsId) {
            this.materialsId = materialsId;
        }

        public String getMaterialsNo() {
            return materialsNo;
        }

        public void setMaterialsNo(String materialsNo) {
            this.materialsNo = materialsNo;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            PurchaseAddMaterialsSkuDTO that = (PurchaseAddMaterialsSkuDTO) o;

            if (materialsSkuId != null ? !materialsSkuId.equals(that.materialsSkuId) : that.materialsSkuId != null)
                return false;
            return facMissionId != null ? facMissionId.equals(that.facMissionId) : that.facMissionId == null;
        }

        @Override
        public int hashCode() {
            int result = materialsSkuId != null ? materialsSkuId.hashCode() : 0;
            result = 31 * result + (facMissionId != null ? facMissionId.hashCode() : 0);
            return result;
        }
    }

}
